function addMedal(g_uid) {
    //var uid = getQueryVariable("uid");
    var uid = g_uid;
    return "<input type=\"text\" id=\"medalName\" placeholder=\"徽章名\"/><input type=\"text\" id=\"medalUrl\" placeholder=\"徽章图片链接\"/>\n" +
        "<input type=\"text\" id=\"medalSale\" placeholder=\"徽章价格默认0\"/><input type=\"button\" onclick=\"ajaxpost_addMedal(" + uid + ")\" value=\"点击增加\"/>\n" +
        "<button onclick=\"getElementById('addMedal').innerHTML=''\">取消</button><hr/>";
}

function changeSelectRank(changeid) {
    //selectForum
    if (changeid == 2) {
        return "<input id='selectForumval' type='text'/>";
    } else
        return "";
}

//js获取get参数方法，找到后想起来其实用带参的函数也行……
function getQueryVariable(variable) {
    var query = window.location.search.substring(1);
    var vars = query.split("&");
    for (var i = 0; i < vars.length; i++) {
        var pair = vars[i].split("=");
        if (pair[0] == variable) {
            return pair[1];
        }
    }
    return (false);
}

function editContentText(Content) {
    return "<!-- 加载编辑器的容器 -->\n" +
        "        <script id=\"edit_container\" name=\"content\" type=\"text/plain\">\n" +
        Content +
        "        </script>\n" +
        "        <!-- 配置文件 -->\n" +
        "        <script type=\"text/javascript\" src=\"utf8-php/ueditor.config.js\"></script>\n" +
        "        <!-- 编辑器源码文件 -->\n" +
        "        <script type=\"text/javascript\" src=\"utf8-php/ueditor.all.js\"></script>\n" +
        "        <!-- 实例化编辑器 -->\n" +
        "        <script type=\"text/javascript\">\n" +
        "            var ue = UE.getEditor('edit_container');\n" +
        "        </script>";
}

// $(document).ready(function () {
//     $("#likepng").on("click", function () {
//         $.get("get.php", {name: $("#btn").val()}, function (data) {
//             $("#like").text(data);
//         });
//     });
// });
function ulike() {
    alert("不能这么不要脸给自己点赞！");
}

function olike(url) {
    var r = confirm("请登陆！");
    if (r)
        window.location = "login.php?back=" + url;
}

function change_filter_status(id, fid) {
    var filterVal = $("#filter_status").val();
    location.href = location.href = "admin.php?type=area&id=" + id + "&forumid=" + fid + "&filter=" + filterVal + "#topic";
}

function add_lzl_post(tid, pid, uid, uname = null) {
    if (uname != null) {
        return "<textarea id='lzl" + pid + "' cols='40' rows='4'>回复 " + uname + "：</textarea>" +
            "<a href='#reply" + pid + "' onclick='ajaxpost_lzl(" + tid + "," + pid + "," + uid + ")'>回复</a> " +
            " <a href=\"#reply" + pid + "\" onclick=\"getElementById(\'addLzl" + pid + "\').innerHTML=\'\'\">取消</a>";
    } else {
        return "<textarea id='lzl" + pid + "' cols='40' rows='4'></textarea>" +
            "<a href='#reply" + pid + "' onclick='ajaxpost_lzl(" + tid + "," + pid + "," + uid + ")'>回复</a> " +
            " <a href=\"#reply" + pid + "\" onclick=\"getElementById(\'addLzl" + pid + "\').innerHTML=\'\'\">取消</a>";
    }
}

